package skdao

import (
	"Cgo/front/models"
	"Cgo/global"
)

type ssDao struct{}

var SsDao = ssDao{}

func (l ssDao) GetBookInfo(bookName string) (models.SkBook, error) {
	var book models.SkBook
	if r := global.DB.Where("bookName like ?", "%"+bookName+"%").Find(&book); r.RowsAffected > 0 {
		return book, nil
	} else {
		return book, r.Error
	}

}
